<!DOCTYPE html>
<html>
  
<head><meta name="generator" content="Hexo 3.9.0">
  <meta charset="utf-8">
  <meta name="author" content="Aa Y">
  
  
  <title>ANetDemo | Yaa&#39;s Bolg</title>

  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

  
    <meta name="keywords" content="CV,">
  

  
  <meta name="description" content="Demo">

  

  
    <script src="//cdn.jsdelivr.net/npm/leancloud-storage@3.11.1/dist/av-min.js" async></script>
  

  

  
    <script src="//unpkg.com/valine/dist/Valine.min.js" async></script>
  

  

  <script>
  // theme-ad's config script
  // it can be used in every script
  
  window.AD_CONFIG = {
    leancloud: {"appid":"fmmQ5HHXBeCLVf0DYXAfyBnM-gzGzoHsz","appkey":"WaRxtuWpVWcnAiqd2erlT4vy","comment":true,"count":true},
    welcome: {"enable":false,"interval":30},
    start_time: "2019-05-01",
    passwords: ["efe07af7441da2b69c4a41e42e73be4db47f66010a56900788a458354a7373ec", ],
    is_post: true,
    lock: false,
    author: "Aa Y",
    share: {"twitter":false,"facebook":false,"weibo":true,"qq":true,"wechat":true},
    mathjax: false,
    page_type: "",
    root: "/blog/"
  };
</script>

  <script src="/blog/vendor/sha256.min.js"></script>
<script src="/blog/js/auth.js"></script>
<script src="/blog/js/index.js"></script>
<script src="/blog/vendor/qrcode.min.js"></script>

  
    <link rel="icon" href="/blog/images/favicon.ico">
    <link rel="apple-touch-icon" href="/blog/images/touch-icon.png">
  

  <link href="//netdna.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
  <link href="https://cdn.bootcss.com/KaTeX/0.7.1/katex.min.css" rel="stylesheet">

  <link rel="stylesheet" href="/blog/css/index.css">
<link rel="stylesheet" href="/blog/styles/components/highlight/highlight.css">

  
</head>
  <body>
    <header class="site-header">
  <div class="site-header-brand">
    
      <span class="site-header-brand-title">
        <a href="/blog/">Yaa</a>
      </span>
    
    
      <span class="site-header-brand-motto"> | Blog</span>
    
  </div>
  <div class="site-header-right">
    <nav class="site-header-navigation">
      
        <a href="/blog/" target="_self">首页</a>
      
        <a href="/blog/archives/" target="_self">归档</a>
      
        <a href="/blog/tags/" target="_self">标签</a>
      
        <a href="/blog/categories/" target="_self">分类</a>
      
        <a href="/blog/about/" target="_self">关于</a>
      
    </nav>
    <div class="site-header-btn">
      
        <a href="https://github.com/zyayoung/" target="_blank" id="site-github">
          <i class="fa fa-github-alt"></i>
        </a>
      
      <a href="javascript:void(0);" id="site-search">
        <i class="fa fa-search"></i>
      </a>
      <a href="javascript:void(0);" id="site-nav-btn">
        <i class="fa fa-ellipsis-v"></i>
      </a>
    </div>
  </div>
</header>
<nav class="table-content" id="site-nav">
  <div class="table-content-title">
    <span>导航</span>
  </div>
  <div class="table-content-main">
    <ol class="toc">
      
        <li class="toc-item">
          <a href="/blog/" target="_self">
            首页
          </a>
        </li>
      
        <li class="toc-item">
          <a href="/blog/archives/" target="_self">
            归档
          </a>
        </li>
      
        <li class="toc-item">
          <a href="/blog/tags/" target="_self">
            标签
          </a>
        </li>
      
        <li class="toc-item">
          <a href="/blog/categories/" target="_self">
            分类
          </a>
        </li>
      
        <li class="toc-item">
          <a href="/blog/about/" target="_self">
            关于
          </a>
        </li>
      
    </ol>
  </div>
</nav>
<div id="site-process"></div>
    <main>
      
  <div class="passage">
  <div class="passage-meta">
    <span>
      <i class="fa fa-calendar"></i>2019-10-07
    </span>
    
      <span>
        | <a href="/blog/categories/CV/"><i class="fa fa-bookmark"></i>CV</a>
      </span>
    
    
      <span>
        | <i class="fa fa-unlock-alt"></i>UNLOCK
      </span>
    
  </div>
  <h1 class="passage-title">
    ANetDemo
  </h1>
  
  <article class="passage-article">
    <style>
    .upload-btn-wrapper {
        position: relative;
        overflow: hidden;
        display: block;
        width: 100%;
    }

    .btn {
        border: 2px solid gray;
        color: gray;
        background-color: white;
        padding: 8px 20px;
        border-radius: 8px;
        font-size: 20px;
        font-weight: bold;
        width: 100%;
    }

    .upload-btn-wrapper input[type=file] {
        font-size: 100px;
        position: absolute;
        left: 0;
        top: 0;
        opacity: 0;
    }
    
    .result {
        font-size: larger;
    }
</style>


<script src="https://cdn.jsdelivr.net/npm/onnxjs/dist/onnx.min.js"></script>
<script>/**
 * umd minified file from https://github.com/scijs/ndarray
 */
!function(t){var e={};function r(a){if(e[a])return e[a].exports;var n=e[a]={i:a,l:!1,exports:{}};return t[a].call(n.exports,n,n.exports,r),n.l=!0,n.exports}r.m=t,r.c=e,r.d=function(t,e,a){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:a})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var a=Object.create(null);if(r.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)r.d(a,n,function(e){return t[e]}.bind(null,n));return a},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=8)}([function(t,e,r){var a;!function(n){"use strict";function i(t,e,r){var a,n=document.createElement("img");return n.onerror=function(a){return i.onerror(n,a,t,e,r)},n.onload=function(a){return i.onload(n,a,t,e,r)},"string"==typeof t?(i.fetchBlob(t,function(e){e?(t=e,a=i.createObjectURL(t)):(a=t,r&&r.crossOrigin&&(n.crossOrigin=r.crossOrigin)),n.src=a},r),n):i.isInstanceOf("Blob",t)||i.isInstanceOf("File",t)?(a=n._objectURL=i.createObjectURL(t))?(n.src=a,n):i.readFile(t,function(t){var r=t.target;r&&r.result?n.src=r.result:e&&e(t)}):void 0}var o=n.createObjectURL&&n||n.URL&&URL.revokeObjectURL&&URL||n.webkitURL&&webkitURL;function s(t,e){!t._objectURL||e&&e.noRevoke||(i.revokeObjectURL(t._objectURL),delete t._objectURL)}i.fetchBlob=function(t,e,r){e()},i.isInstanceOf=function(t,e){return Object.prototype.toString.call(e)==="[object "+t+"]"},i.transform=function(t,e,r,a,n){r(t,n)},i.onerror=function(t,e,r,a,n){s(t,n),a&&a.call(t,e)},i.onload=function(t,e,r,a,n){s(t,n),a&&i.transform(t,n,a,r,{})},i.createObjectURL=function(t){return!!o&&o.createObjectURL(t)},i.revokeObjectURL=function(t){return!!o&&o.revokeObjectURL(t)},i.readFile=function(t,e,r){if(n.FileReader){var a=new FileReader;if(a.onload=a.onerror=e,a[r=r||"readAsDataURL"])return a[r](t),a}return!1},void 0===(a=function(){return i}.call(e,r,e,t))||(t.exports=a)}("undefined"!=typeof window&&window||this)},function(t,e,r){var a,n,i;!function(o){"use strict";n=[r(0)],void 0===(i="function"==typeof(a=function(t){var e="undefined"!=typeof Blob&&(Blob.prototype.slice||Blob.prototype.webkitSlice||Blob.prototype.mozSlice);t.blobSlice=e&&function(){var t=this.slice||this.webkitSlice||this.mozSlice;return t.apply(this,arguments)},t.metaDataParsers={jpeg:{65505:[],65517:[]}},t.parseMetaData=function(e,r,a,n){a=a||{},n=n||{};var i=this,o=a.maxMetaDataSize||262144,s=!("undefined"!=typeof DataView&&e&&e.size>=12&&"image/jpeg"===e.type&&t.blobSlice);!s&&t.readFile(t.blobSlice.call(e,0,o),function(e){if(e.target.error)return console.log(e.target.error),void r(n);var o,s,u,c,h=e.target.result,l=new DataView(h),f=2,p=l.byteLength-4,g=f;if(65496===l.getUint16(0)){for(;f<p&&((o=l.getUint16(f))>=65504&&o<=65519||65534===o);){if(s=l.getUint16(f+2)+2,f+s>l.byteLength){console.log("Invalid meta data: Invalid segment size.");break}if(u=t.metaDataParsers.jpeg[o])for(c=0;c<u.length;c+=1)u[c].call(i,l,f,s,n,a);g=f+=s}!a.disableImageHead&&g>6&&(h.slice?n.imageHead=h.slice(0,g):n.imageHead=new Uint8Array(h).subarray(0,g))}else console.log("Invalid JPEG file: Missing JPEG marker.");r(n)},"readAsArrayBuffer")||r(n)},t.hasMetaOption=function(t){return t&&t.meta};var r=t.transform;t.transform=function(e,a,n,i,o){t.hasMetaOption(a)?t.parseMetaData(i,function(o){r.call(t,e,a,n,i,o)},a,o):r.apply(t,arguments)}})?a.apply(e,n):a)||(t.exports=i)}()},function(t,e,r){var a,n,i;!function(o){"use strict";n=[r(0)],void 0===(i="function"==typeof(a=function(t){var e=t.transform;t.transform=function(r,a,n,i,o){e.call(t,t.scale(r,a,o),a,n,i,o)},t.transformCoordinates=function(){},t.getTransformedOptions=function(t,e){var r,a,n,i,o=e.aspectRatio;if(!o)return e;for(a in r={},e)e.hasOwnProperty(a)&&(r[a]=e[a]);return r.crop=!0,n=t.naturalWidth||t.width,i=t.naturalHeight||t.height,n/i>o?(r.maxWidth=i*o,r.maxHeight=i):(r.maxWidth=n,r.maxHeight=n/o),r},t.renderImageToCanvas=function(t,e,r,a,n,i,o,s,u,c){return t.getContext("2d").drawImage(e,r,a,n,i,o,s,u,c),t},t.hasCanvasOption=function(t){return t.canvas||t.crop||!!t.aspectRatio},t.scale=function(e,r,a){r=r||{};var n,i,o,s,u,c,h,l,f,p,g,d=document.createElement("canvas"),y=e.getContext||t.hasCanvasOption(r)&&d.getContext,b=e.naturalWidth||e.width,m=e.naturalHeight||e.height,v=b,_=m;function x(){var t=Math.max((o||v)/v,(s||_)/_);t>1&&(v*=t,_*=t)}function w(){var t=Math.min((n||v)/v,(i||_)/_);t<1&&(v*=t,_*=t)}if(y&&(r=t.getTransformedOptions(e,r,a),h=r.left||0,l=r.top||0,r.sourceWidth?(u=r.sourceWidth,void 0!==r.right&&void 0===r.left&&(h=b-u-r.right)):u=b-h-(r.right||0),r.sourceHeight?(c=r.sourceHeight,void 0!==r.bottom&&void 0===r.top&&(l=m-c-r.bottom)):c=m-l-(r.bottom||0),v=u,_=c),n=r.maxWidth,i=r.maxHeight,o=r.minWidth,s=r.minHeight,y&&n&&i&&r.crop?(v=n,_=i,(g=u/c-n/i)<0?(c=i*u/n,void 0===r.top&&void 0===r.bottom&&(l=(m-c)/2)):g>0&&(u=n*c/i,void 0===r.left&&void 0===r.right&&(h=(b-u)/2))):((r.contain||r.cover)&&(o=n=n||o,s=i=i||s),r.cover?(w(),x()):(x(),w())),y){if((f=r.pixelRatio)>1&&(d.style.width=v+"px",d.style.height=_+"px",v*=f,_*=f,d.getContext("2d").scale(f,f)),(p=r.downsamplingRatio)>0&&p<1&&v<u&&_<c)for(;u*p>v;)d.width=u*p,d.height=c*p,t.renderImageToCanvas(d,e,h,l,u,c,0,0,d.width,d.height),h=0,l=0,u=d.width,c=d.height,(e=document.createElement("canvas")).width=u,e.height=c,t.renderImageToCanvas(e,d,0,0,u,c,0,0,u,c);return d.width=v,d.height=_,t.transformCoordinates(d,r),t.renderImageToCanvas(d,e,h,l,u,c,0,0,v,_)}return e.width=v,e.height=_,e}})?a.apply(e,n):a)||(t.exports=i)}()},function(t,e,r){var a,n,i;!function(o){"use strict";n=[r(0),r(1)],void 0===(i="function"==typeof(a=function(t){t.ExifMap=function(){return this},t.ExifMap.prototype.map={Orientation:274},t.ExifMap.prototype.get=function(t){return this[t]||this[this.map[t]]},t.getExifThumbnail=function(e,r,a){if(a&&!(r+a>e.byteLength))return t.createObjectURL(new Blob([e.buffer.slice(r,r+a)]));console.log("Invalid Exif data: Invalid thumbnail data.")},t.exifTagTypes={1:{getValue:function(t,e){return t.getUint8(e)},size:1},2:{getValue:function(t,e){return String.fromCharCode(t.getUint8(e))},size:1,ascii:!0},3:{getValue:function(t,e,r){return t.getUint16(e,r)},size:2},4:{getValue:function(t,e,r){return t.getUint32(e,r)},size:4},5:{getValue:function(t,e,r){return t.getUint32(e,r)/t.getUint32(e+4,r)},size:8},9:{getValue:function(t,e,r){return t.getInt32(e,r)},size:4},10:{getValue:function(t,e,r){return t.getInt32(e,r)/t.getInt32(e+4,r)},size:8}},t.exifTagTypes[7]=t.exifTagTypes[1],t.getExifValue=function(e,r,a,n,i,o){var s,u,c,h,l,f,p=t.exifTagTypes[n];if(p){if(s=p.size*i,!((u=s>4?r+e.getUint32(a+8,o):a+8)+s>e.byteLength)){if(1===i)return p.getValue(e,u,o);for(c=[],h=0;h<i;h+=1)c[h]=p.getValue(e,u+h*p.size,o);if(p.ascii){for(l="",h=0;h<c.length&&"\0"!==(f=c[h]);h+=1)l+=f;return l}return c}console.log("Invalid Exif data: Invalid data offset.")}else console.log("Invalid Exif data: Invalid tag type.")},t.parseExifTag=function(e,r,a,n,i){var o=e.getUint16(a,n);i.exif[o]=t.getExifValue(e,r,a,e.getUint16(a+2,n),e.getUint32(a+4,n),n)},t.parseExifTags=function(t,e,r,a,n){var i,o,s;if(r+6>t.byteLength)console.log("Invalid Exif data: Invalid directory offset.");else{if(i=t.getUint16(r,a),!((o=r+2+12*i)+4>t.byteLength)){for(s=0;s<i;s+=1)this.parseExifTag(t,e,r+2+12*s,a,n);return t.getUint32(o,a)}console.log("Invalid Exif data: Invalid directory size.")}},t.parseExifData=function(e,r,a,n,i){if(!i.disableExif){var o,s,u,c=r+10;if(1165519206===e.getUint32(r+4))if(c+8>e.byteLength)console.log("Invalid Exif data: Invalid segment size.");else if(0===e.getUint16(r+8)){switch(e.getUint16(c)){case 18761:o=!0;break;case 19789:o=!1;break;default:return void console.log("Invalid Exif data: Invalid byte alignment marker.")}42===e.getUint16(c+2,o)?(s=e.getUint32(c+4,o),n.exif=new t.ExifMap,(s=t.parseExifTags(e,c,c+s,o,n))&&!i.disableExifThumbnail&&(u={exif:{}},s=t.parseExifTags(e,c,c+s,o,u),u.exif[513]&&(n.exif.Thumbnail=t.getExifThumbnail(e,c+u.exif[513],u.exif[514]))),n.exif[34665]&&!i.disableExifSub&&t.parseExifTags(e,c,c+n.exif[34665],o,n),n.exif[34853]&&!i.disableExifGps&&t.parseExifTags(e,c,c+n.exif[34853],o,n)):console.log("Invalid Exif data: Missing TIFF marker.")}else console.log("Invalid Exif data: Missing byte alignment offset.")}},t.metaDataParsers.jpeg[65505].push(t.parseExifData)})?a.apply(e,n):a)||(t.exports=i)}()},function(t,e,r){var a,n,i;!function(o){"use strict";n=[r(0),r(1)],void 0===(i="function"==typeof(a=function(t){t.IptcMap=function(){return this},t.IptcMap.prototype.map={ObjectName:5},t.IptcMap.prototype.get=function(t){return this[t]||this[this.map[t]]},t.parseIptcTags=function(t,e,r,a){function n(t,e,r){for(var a="",n=e;n<e+r;n++)a+=String.fromCharCode(t.getUint8(n));return a}for(var i,o,s,u=e;u<e+r;)28===t.getUint8(u)&&2===t.getUint8(u+1)&&(s=t.getUint8(u+2))in a.iptc.tags&&(o=t.getInt16(u+3),i=n(t,u+5,o),a.iptc.hasOwnProperty(s)?a.iptc[s]instanceof Array?a.iptc[s].push(i):a.iptc[s]=[a.iptc[s],i]:a.iptc[s]=i),u++},t.parseIptcData=function(e,r,a,n,i){if(!i.disableIptc){for(var o=r+a,s=function(t,e){return 943868237===t.getUint32(e)&&1028===t.getUint16(e+4)};r+8<o;){if(s(e,r)){var u=e.getUint8(r+7);u%2!=0&&(u+=1),0===u&&(u=4);var c=r+8+u;if(c>o){console.log("Invalid IPTC data: Invalid segment offset.");break}var h=e.getUint16(r+6+u);if(r+h>o){console.log("Invalid IPTC data: Invalid segment size.");break}return n.iptc=new t.IptcMap,t.parseIptcTags(e,c,h,n)}r++}console.log("No IPTC data at this offset - could be XMP")}},t.metaDataParsers.jpeg[65517].push(t.parseIptcData)})?a.apply(e,n):a)||(t.exports=i)}()},function(t,e,r){var a=r(9),n=r(10),i="undefined"!=typeof Float64Array;function o(t,e){return t[0]-e[0]}function s(){var t,e=this.stride,r=new Array(e.length);for(t=0;t<r.length;++t)r[t]=[Math.abs(e[t]),t];r.sort(o);var a=new Array(r.length);for(t=0;t<a.length;++t)a[t]=r[t][1];return a}function u(t,e){var r=["View",e,"d",t].join("");e<0&&(r="View_Nil"+t);var n="generic"===t;if(-1===e){var i="function "+r+"(a){this.data=a;};var proto="+r+".prototype;proto.dtype='"+t+"';proto.index=function(){return -1};proto.size=0;proto.dimension=-1;proto.shape=proto.stride=proto.order=[];proto.lo=proto.hi=proto.transpose=proto.step=function(){return new "+r+"(this.data);};proto.get=proto.set=function(){};proto.pick=function(){return null};return function construct_"+r+"(a){return new "+r+"(a);}";return new Function(i)()}if(0===e){i="function "+r+"(a,d) {this.data = a;this.offset = d};var proto="+r+".prototype;proto.dtype='"+t+"';proto.index=function(){return this.offset};proto.dimension=0;proto.size=1;proto.shape=proto.stride=proto.order=[];proto.lo=proto.hi=proto.transpose=proto.step=function "+r+"_copy() {return new "+r+"(this.data,this.offset)};proto.pick=function "+r+"_pick(){return TrivialArray(this.data);};proto.valueOf=proto.get=function "+r+"_get(){return "+(n?"this.data.get(this.offset)":"this.data[this.offset]")+"};proto.set=function "+r+"_set(v){return "+(n?"this.data.set(this.offset,v)":"this.data[this.offset]=v")+"};return function construct_"+r+"(a,b,c,d){return new "+r+"(a,d)}";return new Function("TrivialArray",i)(c[t][0])}i=["'use strict'"];var o=a(e),u=o.map(function(t){return"i"+t}),h="this.offset+"+o.map(function(t){return"this.stride["+t+"]*i"+t}).join("+"),l=o.map(function(t){return"b"+t}).join(","),f=o.map(function(t){return"c"+t}).join(",");i.push("function "+r+"(a,"+l+","+f+",d){this.data=a","this.shape=["+l+"]","this.stride=["+f+"]","this.offset=d|0}","var proto="+r+".prototype","proto.dtype='"+t+"'","proto.dimension="+e),i.push("Object.defineProperty(proto,'size',{get:function "+r+"_size(){return "+o.map(function(t){return"this.shape["+t+"]"}).join("*"),"}})"),1===e?i.push("proto.order=[0]"):(i.push("Object.defineProperty(proto,'order',{get:"),e<4?(i.push("function "+r+"_order(){"),2===e?i.push("return (Math.abs(this.stride[0])>Math.abs(this.stride[1]))?[1,0]:[0,1]}})"):3===e&&i.push("var s0=Math.abs(this.stride[0]),s1=Math.abs(this.stride[1]),s2=Math.abs(this.stride[2]);if(s0>s1){if(s1>s2){return [2,1,0];}else if(s0>s2){return [1,2,0];}else{return [1,0,2];}}else if(s0>s2){return [2,0,1];}else if(s2>s1){return [0,1,2];}else{return [0,2,1];}}})")):i.push("ORDER})")),i.push("proto.set=function "+r+"_set("+u.join(",")+",v){"),n?i.push("return this.data.set("+h+",v)}"):i.push("return this.data["+h+"]=v}"),i.push("proto.get=function "+r+"_get("+u.join(",")+"){"),n?i.push("return this.data.get("+h+")}"):i.push("return this.data["+h+"]}"),i.push("proto.index=function "+r+"_index(",u.join(),"){return "+h+"}"),i.push("proto.hi=function "+r+"_hi("+u.join(",")+"){return new "+r+"(this.data,"+o.map(function(t){return["(typeof i",t,"!=='number'||i",t,"<0)?this.shape[",t,"]:i",t,"|0"].join("")}).join(",")+","+o.map(function(t){return"this.stride["+t+"]"}).join(",")+",this.offset)}");var p=o.map(function(t){return"a"+t+"=this.shape["+t+"]"}),g=o.map(function(t){return"c"+t+"=this.stride["+t+"]"});i.push("proto.lo=function "+r+"_lo("+u.join(",")+"){var b=this.offset,d=0,"+p.join(",")+","+g.join(","));for(var d=0;d<e;++d)i.push("if(typeof i"+d+"==='number'&&i"+d+">=0){d=i"+d+"|0;b+=c"+d+"*d;a"+d+"-=d}");i.push("return new "+r+"(this.data,"+o.map(function(t){return"a"+t}).join(",")+","+o.map(function(t){return"c"+t}).join(",")+",b)}"),i.push("proto.step=function "+r+"_step("+u.join(",")+"){var "+o.map(function(t){return"a"+t+"=this.shape["+t+"]"}).join(",")+","+o.map(function(t){return"b"+t+"=this.stride["+t+"]"}).join(",")+",c=this.offset,d=0,ceil=Math.ceil");for(d=0;d<e;++d)i.push("if(typeof i"+d+"==='number'){d=i"+d+"|0;if(d<0){c+=b"+d+"*(a"+d+"-1);a"+d+"=ceil(-a"+d+"/d)}else{a"+d+"=ceil(a"+d+"/d)}b"+d+"*=d}");i.push("return new "+r+"(this.data,"+o.map(function(t){return"a"+t}).join(",")+","+o.map(function(t){return"b"+t}).join(",")+",c)}");var y=new Array(e),b=new Array(e);for(d=0;d<e;++d)y[d]="a[i"+d+"]",b[d]="b[i"+d+"]";i.push("proto.transpose=function "+r+"_transpose("+u+"){"+u.map(function(t,e){return t+"=("+t+"===undefined?"+e+":"+t+"|0)"}).join(";"),"var a=this.shape,b=this.stride;return new "+r+"(this.data,"+y.join(",")+","+b.join(",")+",this.offset)}"),i.push("proto.pick=function "+r+"_pick("+u+"){var a=[],b=[],c=this.offset");for(d=0;d<e;++d)i.push("if(typeof i"+d+"==='number'&&i"+d+">=0){c=(c+this.stride["+d+"]*i"+d+")|0}else{a.push(this.shape["+d+"]);b.push(this.stride["+d+"])}");return i.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}"),i.push("return function construct_"+r+"(data,shape,stride,offset){return new "+r+"(data,"+o.map(function(t){return"shape["+t+"]"}).join(",")+","+o.map(function(t){return"stride["+t+"]"}).join(",")+",offset)}"),new Function("CTOR_LIST","ORDER",i.join("\n"))(c[t],s)}var c={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],buffer:[],generic:[]};t.exports=function(t,e,r,a){if(void 0===t)return(0,c.array[0])([]);"number"==typeof t&&(t=[t]),void 0===e&&(e=[t.length]);var o=e.length;if(void 0===r){r=new Array(o);for(var s=o-1,h=1;s>=0;--s)r[s]=h,h*=e[s]}if(void 0===a)for(a=0,s=0;s<o;++s)r[s]<0&&(a-=(e[s]-1)*r[s]);for(var l=function(t){if(n(t))return"buffer";if(i)switch(Object.prototype.toString.call(t)){case"[object Float64Array]":return"float64";case"[object Float32Array]":return"float32";case"[object Int8Array]":return"int8";case"[object Int16Array]":return"int16";case"[object Int32Array]":return"int32";case"[object Uint8Array]":return"uint8";case"[object Uint16Array]":return"uint16";case"[object Uint32Array]":return"uint32";case"[object Uint8ClampedArray]":return"uint8_clamped"}return Array.isArray(t)?"array":"generic"}(t),f=c[l];f.length<=o+1;)f.push(u(l,f.length-1));return(0,f[o+1])(t,e,r,a)}},function(t,e,r){"use strict";var a=r(11),n={body:"",args:[],thisVars:[],localVars:[]};function i(t){if(!t)return n;for(var e=0;e<t.args.length;++e){var r=t.args[e];t.args[e]=0===e?{name:r,lvalue:!0,rvalue:!!t.rvalue,count:t.count||1}:{name:r,lvalue:!1,rvalue:!0,count:1}}return t.thisVars||(t.thisVars=[]),t.localVars||(t.localVars=[]),t}function o(t){for(var e=[],r=0;r<t.args.length;++r)e.push("a"+r);return new Function("P",["return function ",t.funcName,"_ndarrayops(",e.join(","),") {P(",e.join(","),");return a0}"].join(""))(function(t){return a({args:t.args,pre:i(t.pre),body:i(t.body),post:i(t.proc),funcName:t.funcName})}(t))}var s={add:"+",sub:"-",mul:"*",div:"/",mod:"%",band:"&",bor:"|",bxor:"^",lshift:"<<",rshift:">>",rrshift:">>>"};!function(){for(var t in s){var r=s[t];e[t]=o({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+r+"c"},funcName:t}),e[t+"eq"]=o({args:["array","array"],body:{args:["a","b"],body:"a"+r+"=b"},rvalue:!0,funcName:t+"eq"}),e[t+"s"]=o({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+r+"s"},funcName:t+"s"}),e[t+"seq"]=o({args:["array","scalar"],body:{args:["a","s"],body:"a"+r+"=s"},rvalue:!0,funcName:t+"seq"})}}();var u={not:"!",bnot:"~",neg:"-",recip:"1.0/"};!function(){for(var t in u){var r=u[t];e[t]=o({args:["array","array"],body:{args:["a","b"],body:"a="+r+"b"},funcName:t}),e[t+"eq"]=o({args:["array"],body:{args:["a"],body:"a="+r+"a"},rvalue:!0,count:2,funcName:t+"eq"})}}();var c={and:"&&",or:"||",eq:"===",neq:"!==",lt:"<",gt:">",leq:"<=",geq:">="};!function(){for(var t in c){var r=c[t];e[t]=o({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+r+"c"},funcName:t}),e[t+"s"]=o({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+r+"s"},funcName:t+"s"}),e[t+"eq"]=o({args:["array","array"],body:{args:["a","b"],body:"a=a"+r+"b"},rvalue:!0,count:2,funcName:t+"eq"}),e[t+"seq"]=o({args:["array","scalar"],body:{args:["a","s"],body:"a=a"+r+"s"},rvalue:!0,count:2,funcName:t+"seq"})}}();var h=["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan"];!function(){for(var t=0;t<h.length;++t){var r=h[t];e[r]=o({args:["array","array"],pre:{args:[],body:"this_f=Math."+r,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(b)",thisVars:["this_f"]},funcName:r}),e[r+"eq"]=o({args:["array"],pre:{args:[],body:"this_f=Math."+r,thisVars:["this_f"]},body:{args:["a"],body:"a=this_f(a)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:r+"eq"})}}();var l=["max","min","atan2","pow"];!function(){for(var t=0;t<l.length;++t){var r=l[t];e[r]=o({args:["array","array","array"],pre:{args:[],body:"this_f=Math."+r,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(b,c)",thisVars:["this_f"]},funcName:r}),e[r+"s"]=o({args:["array","array","scalar"],pre:{args:[],body:"this_f=Math."+r,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(b,c)",thisVars:["this_f"]},funcName:r+"s"}),e[r+"eq"]=o({args:["array","array"],pre:{args:[],body:"this_f=Math."+r,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(a,b)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:r+"eq"}),e[r+"seq"]=o({args:["array","scalar"],pre:{args:[],body:"this_f=Math."+r,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(a,b)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:r+"seq"})}}();var f=["atan2","pow"];!function(){for(var t=0;t<f.length;++t){var r=f[t];e[r+"op"]=o({args:["array","array","array"],pre:{args:[],body:"this_f=Math."+r,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(c,b)",thisVars:["this_f"]},funcName:r+"op"}),e[r+"ops"]=o({args:["array","array","scalar"],pre:{args:[],body:"this_f=Math."+r,thisVars:["this_f"]},body:{args:["a","b","c"],body:"a=this_f(c,b)",thisVars:["this_f"]},funcName:r+"ops"}),e[r+"opeq"]=o({args:["array","array"],pre:{args:[],body:"this_f=Math."+r,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(b,a)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:r+"opeq"}),e[r+"opseq"]=o({args:["array","scalar"],pre:{args:[],body:"this_f=Math."+r,thisVars:["this_f"]},body:{args:["a","b"],body:"a=this_f(b,a)",thisVars:["this_f"]},rvalue:!0,count:2,funcName:r+"opseq"})}}(),e.any=a({args:["array"],pre:n,body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:1}],body:"if(a){return true}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return false"},funcName:"any"}),e.all=a({args:["array"],pre:n,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1}],body:"if(!x){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"all"}),e.sum=a({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:1}],body:"this_s+=a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"sum"}),e.prod=a({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=1"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:1}],body:"this_s*=a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"prod"}),e.norm2squared=a({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:2}],body:"this_s+=a*a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm2squared"}),e.norm2=a({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:2}],body:"this_s+=a*a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return Math.sqrt(this_s)"},funcName:"norm2"}),e.norminf=a({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:4}],body:"if(-a>this_s){this_s=-a}else if(a>this_s){this_s=a}",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norminf"}),e.norm1=a({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:3}],body:"this_s+=a<0?-a:a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm1"}),e.sup=a({args:["array"],pre:{body:"this_h=-Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_>this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),e.inf=a({args:["array"],pre:{body:"this_h=Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_<this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),e.argmin=a({args:["index","array","shape"],pre:{body:"{this_v=Infinity;this_i=_inline_0_arg2_.slice(0)}",args:[{name:"_inline_0_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg2_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_i","this_v"],localVars:[]},body:{body:"{if(_inline_1_arg1_<this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),e.argmax=a({args:["index","array","shape"],pre:{body:"{this_v=-Infinity;this_i=_inline_0_arg2_.slice(0)}",args:[{name:"_inline_0_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_0_arg2_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_i","this_v"],localVars:[]},body:{body:"{if(_inline_1_arg1_>this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),e.random=o({args:["array"],pre:{args:[],body:"this_f=Math.random",thisVars:["this_f"]},body:{args:["a"],body:"a=this_f()",thisVars:["this_f"]},funcName:"random"}),e.assign=o({args:["array","array"],body:{args:["a","b"],body:"a=b"},funcName:"assign"}),e.assigns=o({args:["array","scalar"],body:{args:["a","b"],body:"a=b"},funcName:"assigns"}),e.equals=a({args:["array","array"],pre:n,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1},{name:"y",lvalue:!1,rvalue:!0,count:1}],body:"if(x!==y){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"equals"})},function(t,e,r){t.exports=r(0),r(2),r(1),r(15),r(3),r(16),r(4),r(17),r(18)},function(t,e,r){"use strict";r.r(e);var a=r(5),n=r(6),i=r(7);window.ndarray=a,window.ndarray.ops=n,window.loadImage=i},function(t,e,r){"use strict";t.exports=function(t){for(var e=new Array(t),r=0;r<t;++r)e[r]=r;return e}},function(t,e){function r(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}
/*!
 * Determine if an object is a Buffer
 *
 * @author   Feross Aboukhadijeh <https://feross.org>
 * @license  MIT
 */
t.exports=function(t){return null!=t&&(r(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&r(t.slice(0,0))}(t)||!!t._isBuffer)}},function(t,e,r){"use strict";var a=r(12);t.exports=function(t){var e=new function(){this.argTypes=[],this.shimArgs=[],this.arrayArgs=[],this.arrayBlockIndices=[],this.scalarArgs=[],this.offsetArgs=[],this.offsetArgIndex=[],this.indexArgs=[],this.shapeArgs=[],this.funcName="",this.pre=null,this.body=null,this.post=null,this.debug=!1};e.pre=t.pre,e.body=t.body,e.post=t.post;var r=t.args.slice(0);e.argTypes=r;for(var n=0;n<r.length;++n){var i=r[n];if("array"===i||"object"==typeof i&&i.blockIndices){if(e.argTypes[n]="array",e.arrayArgs.push(n),e.arrayBlockIndices.push(i.blockIndices?i.blockIndices:0),e.shimArgs.push("array"+n),n<e.pre.args.length&&e.pre.args[n].count>0)throw new Error("cwise: pre() block may not reference array args");if(n<e.post.args.length&&e.post.args[n].count>0)throw new Error("cwise: post() block may not reference array args")}else if("scalar"===i)e.scalarArgs.push(n),e.shimArgs.push("scalar"+n);else if("index"===i){if(e.indexArgs.push(n),n<e.pre.args.length&&e.pre.args[n].count>0)throw new Error("cwise: pre() block may not reference array index");if(n<e.body.args.length&&e.body.args[n].lvalue)throw new Error("cwise: body() block may not write to array index");if(n<e.post.args.length&&e.post.args[n].count>0)throw new Error("cwise: post() block may not reference array index")}else if("shape"===i){if(e.shapeArgs.push(n),n<e.pre.args.length&&e.pre.args[n].lvalue)throw new Error("cwise: pre() block may not write to array shape");if(n<e.body.args.length&&e.body.args[n].lvalue)throw new Error("cwise: body() block may not write to array shape");if(n<e.post.args.length&&e.post.args[n].lvalue)throw new Error("cwise: post() block may not write to array shape")}else{if("object"!=typeof i||!i.offset)throw new Error("cwise: Unknown argument type "+r[n]);e.argTypes[n]="offset",e.offsetArgs.push({array:i.array,offset:i.offset}),e.offsetArgIndex.push(n)}}if(e.arrayArgs.length<=0)throw new Error("cwise: No array arguments specified");if(e.pre.args.length>r.length)throw new Error("cwise: Too many arguments in pre() block");if(e.body.args.length>r.length)throw new Error("cwise: Too many arguments in body() block");if(e.post.args.length>r.length)throw new Error("cwise: Too many arguments in post() block");return e.debug=!!t.printCode||!!t.debug,e.funcName=t.funcName||"cwise",e.blockSize=t.blockSize||64,a(e)}},function(t,e,r){"use strict";var a=r(13);t.exports=function(t){var e=["'use strict'","var CACHED={}"],r=[],n=t.funcName+"_cwise_thunk";e.push(["return function ",n,"(",t.shimArgs.join(","),"){"].join(""));for(var i=[],o=[],s=[["array",t.arrayArgs[0],".shape.slice(",Math.max(0,t.arrayBlockIndices[0]),t.arrayBlockIndices[0]<0?","+t.arrayBlockIndices[0]+")":")"].join("")],u=[],c=[],h=0;h<t.arrayArgs.length;++h){var l=t.arrayArgs[h];r.push(["t",l,"=array",l,".dtype,","r",l,"=array",l,".order"].join("")),i.push("t"+l),i.push("r"+l),o.push("t"+l),o.push("r"+l+".join()"),s.push("array"+l+".data"),s.push("array"+l+".stride"),s.push("array"+l+".offset|0"),h>0&&(u.push("array"+t.arrayArgs[0]+".shape.length===array"+l+".shape.length+"+(Math.abs(t.arrayBlockIndices[0])-Math.abs(t.arrayBlockIndices[h]))),c.push("array"+t.arrayArgs[0]+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[0])+"]===array"+l+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[h])+"]"))}for(t.arrayArgs.length>1&&(e.push("if (!("+u.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same dimensionality!')"),e.push("for(var shapeIndex=array"+t.arrayArgs[0]+".shape.length-"+Math.abs(t.arrayBlockIndices[0])+"; shapeIndex--\x3e0;) {"),e.push("if (!("+c.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same shape!')"),e.push("}")),h=0;h<t.scalarArgs.length;++h)s.push("scalar"+t.scalarArgs[h]);return r.push(["type=[",o.join(","),"].join()"].join("")),r.push("proc=CACHED[type]"),e.push("var "+r.join(",")),e.push(["if(!proc){","CACHED[type]=proc=compile([",i.join(","),"])}","return proc(",s.join(","),")}"].join("")),t.debug&&console.log("-----Generated thunk:\n"+e.join("\n")+"\n----------"),new Function("compile",e.join("\n"))(a.bind(void 0,t))}},function(t,e,r){"use strict";var a=r(14);function n(t,e,r){var a,n,i=t.length,o=e.arrayArgs.length,s=e.indexArgs.length>0,u=[],c=[],h=0,l=0;for(a=0;a<i;++a)c.push(["i",a,"=0"].join(""));for(n=0;n<o;++n)for(a=0;a<i;++a)l=h,h=t[a],0===a?c.push(["d",n,"s",a,"=t",n,"p",h].join("")):c.push(["d",n,"s",a,"=(t",n,"p",h,"-s",l,"*t",n,"p",l,")"].join(""));for(c.length>0&&u.push("var "+c.join(",")),a=i-1;a>=0;--a)h=t[a],u.push(["for(i",a,"=0;i",a,"<s",h,";++i",a,"){"].join(""));for(u.push(r),a=0;a<i;++a){for(l=h,h=t[a],n=0;n<o;++n)u.push(["p",n,"+=d",n,"s",a].join(""));s&&(a>0&&u.push(["index[",l,"]-=s",l].join("")),u.push(["++index[",h,"]"].join(""))),u.push("}")}return u.join("\n")}function i(t,e,r){for(var a=t.body,n=[],i=[],o=0;o<t.args.length;++o){var s=t.args[o];if(!(s.count<=0)){var u=new RegExp(s.name,"g"),c="",h=e.arrayArgs.indexOf(o);switch(e.argTypes[o]){case"offset":var l=e.offsetArgIndex.indexOf(o);h=e.offsetArgs[l].array,c="+q"+l;case"array":c="p"+h+c;var f="l"+o,p="a"+h;if(0===e.arrayBlockIndices[h])1===s.count?"generic"===r[h]?s.lvalue?(n.push(["var ",f,"=",p,".get(",c,")"].join("")),a=a.replace(u,f),i.push([p,".set(",c,",",f,")"].join(""))):a=a.replace(u,[p,".get(",c,")"].join("")):a=a.replace(u,[p,"[",c,"]"].join("")):"generic"===r[h]?(n.push(["var ",f,"=",p,".get(",c,")"].join("")),a=a.replace(u,f),s.lvalue&&i.push([p,".set(",c,",",f,")"].join(""))):(n.push(["var ",f,"=",p,"[",c,"]"].join("")),a=a.replace(u,f),s.lvalue&&i.push([p,"[",c,"]=",f].join("")));else{for(var g=[s.name],d=[c],y=0;y<Math.abs(e.arrayBlockIndices[h]);y++)g.push("\\s*\\[([^\\]]+)\\]"),d.push("$"+(y+1)+"*t"+h+"b"+y);if(u=new RegExp(g.join(""),"g"),c=d.join("+"),"generic"===r[h])throw new Error("cwise: Generic arrays not supported in combination with blocks!");a=a.replace(u,[p,"[",c,"]"].join(""))}break;case"scalar":a=a.replace(u,"Y"+e.scalarArgs.indexOf(o));break;case"index":a=a.replace(u,"index");break;case"shape":a=a.replace(u,"shape")}}}return[n.join("\n"),a,i.join("\n")].join("\n").trim()}t.exports=function(t,e){for(var r=e[1].length-Math.abs(t.arrayBlockIndices[0])|0,o=new Array(t.arrayArgs.length),s=new Array(t.arrayArgs.length),u=0;u<t.arrayArgs.length;++u)s[u]=e[2*u],o[u]=e[2*u+1];var c=[],h=[],l=[],f=[],p=[];for(u=0;u<t.arrayArgs.length;++u){t.arrayBlockIndices[u]<0?(l.push(0),f.push(r),c.push(r),h.push(r+t.arrayBlockIndices[u])):(l.push(t.arrayBlockIndices[u]),f.push(t.arrayBlockIndices[u]+r),c.push(0),h.push(t.arrayBlockIndices[u]));for(var g=[],d=0;d<o[u].length;d++)l[u]<=o[u][d]&&o[u][d]<f[u]&&g.push(o[u][d]-l[u]);p.push(g)}var y=["SS"],b=["'use strict'"],m=[];for(d=0;d<r;++d)m.push(["s",d,"=SS[",d,"]"].join(""));for(u=0;u<t.arrayArgs.length;++u){for(y.push("a"+u),y.push("t"+u),y.push("p"+u),d=0;d<r;++d)m.push(["t",u,"p",d,"=t",u,"[",l[u]+d,"]"].join(""));for(d=0;d<Math.abs(t.arrayBlockIndices[u]);++d)m.push(["t",u,"b",d,"=t",u,"[",c[u]+d,"]"].join(""))}for(u=0;u<t.scalarArgs.length;++u)y.push("Y"+u);if(t.shapeArgs.length>0&&m.push("shape=SS.slice(0)"),t.indexArgs.length>0){var v=new Array(r);for(u=0;u<r;++u)v[u]="0";m.push(["index=[",v.join(","),"]"].join(""))}for(u=0;u<t.offsetArgs.length;++u){var _=t.offsetArgs[u],x=[];for(d=0;d<_.offset.length;++d)0!==_.offset[d]&&(1===_.offset[d]?x.push(["t",_.array,"p",d].join("")):x.push([_.offset[d],"*t",_.array,"p",d].join("")));0===x.length?m.push("q"+u+"=0"):m.push(["q",u,"=",x.join("+")].join(""))}var w=a([].concat(t.pre.thisVars).concat(t.body.thisVars).concat(t.post.thisVars));for((m=m.concat(w)).length>0&&b.push("var "+m.join(",")),u=0;u<t.arrayArgs.length;++u)b.push("p"+u+"|=0");t.pre.body.length>3&&b.push(i(t.pre,t,s));var j=i(t.body,t,s),S=function(t){for(var e=0,r=t[0].length;e<r;){for(var a=1;a<t.length;++a)if(t[a][e]!==t[0][e])return e;++e}return e}(p);S<r?b.push(function(t,e,r,a){for(var i=e.length,o=r.arrayArgs.length,s=r.blockSize,u=r.indexArgs.length>0,c=[],h=0;h<o;++h)c.push(["var offset",h,"=p",h].join(""));for(h=t;h<i;++h)c.push(["for(var j"+h+"=SS[",e[h],"]|0;j",h,">0;){"].join("")),c.push(["if(j",h,"<",s,"){"].join("")),c.push(["s",e[h],"=j",h].join("")),c.push(["j",h,"=0"].join("")),c.push(["}else{s",e[h],"=",s].join("")),c.push(["j",h,"-=",s,"}"].join("")),u&&c.push(["index[",e[h],"]=j",h].join(""));for(h=0;h<o;++h){for(var l=["offset"+h],f=t;f<i;++f)l.push(["j",f,"*t",h,"p",e[f]].join(""));c.push(["p",h,"=(",l.join("+"),")"].join(""))}for(c.push(n(e,r,a)),h=t;h<i;++h)c.push("}");return c.join("\n")}(S,p[0],t,j)):b.push(n(p[0],t,j)),t.post.body.length>3&&b.push(i(t.post,t,s)),t.debug&&console.log("-----Generated cwise routine for ",e,":\n"+b.join("\n")+"\n----------");var V=[t.funcName||"unnamed","_cwise_loop_",o[0].join("s"),"m",S,function(t){for(var e=new Array(t.length),r=!0,a=0;a<t.length;++a){var n=t[a],i=n.match(/\d+/);i=i?i[0]:"",0===n.charAt(0)?e[a]="u"+n.charAt(1)+i:e[a]=n.charAt(0)+i,a>0&&(r=r&&e[a]===e[a-1])}return r?e[0]:e.join("")}(s)].join("");return new Function(["function ",V,"(",y.join(","),"){",b.join("\n"),"} return ",V].join(""))()}},function(t,e,r){"use strict";t.exports=function(t,e,r){return 0===t.length?t:e?(r||t.sort(e),function(t,e){for(var r=1,a=t.length,n=t[0],i=t[0],o=1;o<a;++o)if(i=n,e(n=t[o],i)){if(o===r){r++;continue}t[r++]=n}return t.length=r,t}(t,e)):(r||t.sort(),function(t){for(var e=1,r=t.length,a=t[0],n=t[0],i=1;i<r;++i,n=a)if(n=a,(a=t[i])!==n){if(i===e){e++;continue}t[e++]=a}return t.length=e,t}(t))}},function(t,e,r){var a,n,i;!function(o){"use strict";n=[r(0),r(1)],void 0===(i="function"==typeof(a=function(t){"undefined"!=typeof fetch&&"undefined"!=typeof Request&&(t.fetchBlob=function(e,r,a){if(t.hasMetaOption(a))return fetch(new Request(e,a)).then(function(t){return t.blob()}).then(r).catch(function(t){console.log(t),r()});r()})})?a.apply(e,n):a)||(t.exports=i)}()},function(t,e,r){var a,n,i;!function(o){"use strict";n=[r(0),r(3)],void 0===(i="function"==typeof(a=function(t){t.ExifMap.prototype.tags={256:"ImageWidth",257:"ImageHeight",34665:"ExifIFDPointer",34853:"GPSInfoIFDPointer",40965:"InteroperabilityIFDPointer",258:"BitsPerSample",259:"Compression",262:"PhotometricInterpretation",274:"Orientation",277:"SamplesPerPixel",284:"PlanarConfiguration",530:"YCbCrSubSampling",531:"YCbCrPositioning",282:"XResolution",283:"YResolution",296:"ResolutionUnit",273:"StripOffsets",278:"RowsPerStrip",279:"StripByteCounts",513:"JPEGInterchangeFormat",514:"JPEGInterchangeFormatLength",301:"TransferFunction",318:"WhitePoint",319:"PrimaryChromaticities",529:"YCbCrCoefficients",532:"ReferenceBlackWhite",306:"DateTime",270:"ImageDescription",271:"Make",272:"Model",305:"Software",315:"Artist",33432:"Copyright",36864:"ExifVersion",40960:"FlashpixVersion",40961:"ColorSpace",40962:"PixelXDimension",40963:"PixelYDimension",42240:"Gamma",37121:"ComponentsConfiguration",37122:"CompressedBitsPerPixel",37500:"MakerNote",37510:"UserComment",40964:"RelatedSoundFile",36867:"DateTimeOriginal",36868:"DateTimeDigitized",37520:"SubSecTime",37521:"SubSecTimeOriginal",37522:"SubSecTimeDigitized",33434:"ExposureTime",33437:"FNumber",34850:"ExposureProgram",34852:"SpectralSensitivity",34855:"PhotographicSensitivity",34856:"OECF",34864:"SensitivityType",34865:"StandardOutputSensitivity",34866:"RecommendedExposureIndex",34867:"ISOSpeed",34868:"ISOSpeedLatitudeyyy",34869:"ISOSpeedLatitudezzz",37377:"ShutterSpeedValue",37378:"ApertureValue",37379:"BrightnessValue",37380:"ExposureBias",37381:"MaxApertureValue",37382:"SubjectDistance",37383:"MeteringMode",37384:"LightSource",37385:"Flash",37396:"SubjectArea",37386:"FocalLength",41483:"FlashEnergy",41484:"SpatialFrequencyResponse",41486:"FocalPlaneXResolution",41487:"FocalPlaneYResolution",41488:"FocalPlaneResolutionUnit",41492:"SubjectLocation",41493:"ExposureIndex",41495:"SensingMethod",41728:"FileSource",41729:"SceneType",41730:"CFAPattern",41985:"CustomRendered",41986:"ExposureMode",41987:"WhiteBalance",41988:"DigitalZoomRatio",41989:"FocalLengthIn35mmFilm",41990:"SceneCaptureType",41991:"GainControl",41992:"Contrast",41993:"Saturation",41994:"Sharpness",41995:"DeviceSettingDescription",41996:"SubjectDistanceRange",42016:"ImageUniqueID",42032:"CameraOwnerName",42033:"BodySerialNumber",42034:"LensSpecification",42035:"LensMake",42036:"LensModel",42037:"LensSerialNumber",0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude",5:"GPSAltitudeRef",6:"GPSAltitude",7:"GPSTimeStamp",8:"GPSSatellites",9:"GPSStatus",10:"GPSMeasureMode",11:"GPSDOP",12:"GPSSpeedRef",13:"GPSSpeed",14:"GPSTrackRef",15:"GPSTrack",16:"GPSImgDirectionRef",17:"GPSImgDirection",18:"GPSMapDatum",19:"GPSDestLatitudeRef",20:"GPSDestLatitude",21:"GPSDestLongitudeRef",22:"GPSDestLongitude",23:"GPSDestBearingRef",24:"GPSDestBearing",25:"GPSDestDistanceRef",26:"GPSDestDistance",27:"GPSProcessingMethod",28:"GPSAreaInformation",29:"GPSDateStamp",30:"GPSDifferential",31:"GPSHPositioningError"},t.ExifMap.prototype.stringValues={ExposureProgram:{0:"Undefined",1:"Manual",2:"Normal program",3:"Aperture priority",4:"Shutter priority",5:"Creative program",6:"Action program",7:"Portrait mode",8:"Landscape mode"},MeteringMode:{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"},LightSource:{0:"Unknown",1:"Daylight",2:"Fluorescent",3:"Tungsten (incandescent light)",4:"Flash",9:"Fine weather",10:"Cloudy weather",11:"Shade",12:"Daylight fluorescent (D 5700 - 7100K)",13:"Day white fluorescent (N 4600 - 5400K)",14:"Cool white fluorescent (W 3900 - 4500K)",15:"White fluorescent (WW 3200 - 3700K)",17:"Standard light A",18:"Standard light B",19:"Standard light C",20:"D55",21:"D65",22:"D75",23:"D50",24:"ISO studio tungsten",255:"Other"},Flash:{0:"Flash did not fire",1:"Flash fired",5:"Strobe return light not detected",7:"Strobe return light detected",9:"Flash fired, compulsory flash mode",13:"Flash fired, compulsory flash mode, return light not detected",15:"Flash fired, compulsory flash mode, return light detected",16:"Flash did not fire, compulsory flash mode",24:"Flash did not fire, auto mode",25:"Flash fired, auto mode",29:"Flash fired, auto mode, return light not detected",31:"Flash fired, auto mode, return light detected",32:"No flash function",65:"Flash fired, red-eye reduction mode",69:"Flash fired, red-eye reduction mode, return light not detected",71:"Flash fired, red-eye reduction mode, return light detected",73:"Flash fired, compulsory flash mode, red-eye reduction mode",77:"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",79:"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",89:"Flash fired, auto mode, red-eye reduction mode",93:"Flash fired, auto mode, return light not detected, red-eye reduction mode",95:"Flash fired, auto mode, return light detected, red-eye reduction mode"},SensingMethod:{1:"Undefined",2:"One-chip color area sensor",3:"Two-chip color area sensor",4:"Three-chip color area sensor",5:"Color sequential area sensor",7:"Trilinear sensor",8:"Color sequential linear sensor"},SceneCaptureType:{0:"Standard",1:"Landscape",2:"Portrait",3:"Night scene"},SceneType:{1:"Directly photographed"},CustomRendered:{0:"Normal process",1:"Custom process"},WhiteBalance:{0:"Auto white balance",1:"Manual white balance"},GainControl:{0:"None",1:"Low gain up",2:"High gain up",3:"Low gain down",4:"High gain down"},Contrast:{0:"Normal",1:"Soft",2:"Hard"},Saturation:{0:"Normal",1:"Low saturation",2:"High saturation"},Sharpness:{0:"Normal",1:"Soft",2:"Hard"},SubjectDistanceRange:{0:"Unknown",1:"Macro",2:"Close view",3:"Distant view"},FileSource:{3:"DSC"},ComponentsConfiguration:{0:"",1:"Y",2:"Cb",3:"Cr",4:"R",5:"G",6:"B"},Orientation:{1:"top-left",2:"top-right",3:"bottom-right",4:"bottom-left",5:"left-top",6:"right-top",7:"right-bottom",8:"left-bottom"}},t.ExifMap.prototype.getText=function(t){var e=this.get(t);switch(t){case"LightSource":case"Flash":case"MeteringMode":case"ExposureProgram":case"SensingMethod":case"SceneCaptureType":case"SceneType":case"CustomRendered":case"WhiteBalance":case"GainControl":case"Contrast":case"Saturation":case"Sharpness":case"SubjectDistanceRange":case"FileSource":case"Orientation":return this.stringValues[t][e];case"ExifVersion":case"FlashpixVersion":if(!e)return;return String.fromCharCode(e[0],e[1],e[2],e[3]);case"ComponentsConfiguration":if(!e)return;return this.stringValues[t][e[0]]+this.stringValues[t][e[1]]+this.stringValues[t][e[2]]+this.stringValues[t][e[3]];case"GPSVersionID":if(!e)return;return e[0]+"."+e[1]+"."+e[2]+"."+e[3]}return String(e)},function(t){var e,r=t.tags,a=t.map;for(e in r)r.hasOwnProperty(e)&&(a[r[e]]=e)}(t.ExifMap.prototype),t.ExifMap.prototype.getAll=function(){var t,e,r={};for(t in this)this.hasOwnProperty(t)&&(e=this.tags[t])&&(r[e]=this.getText(e));return r}})?a.apply(e,n):a)||(t.exports=i)}()},function(t,e,r){var a,n,i;!function(o){"use strict";n=[r(0),r(4)],void 0===(i="function"==typeof(a=function(t){t.IptcMap.prototype.tags={3:"ObjectType",4:"ObjectAttribute",5:"ObjectName",7:"EditStatus",8:"EditorialUpdate",10:"Urgency",12:"SubjectRef",15:"Category",20:"SupplCategory",22:"FixtureID",25:"Keywords",26:"ContentLocCode",27:"ContentLocName",30:"ReleaseDate",35:"ReleaseTime",37:"ExpirationDate",38:"ExpirationTime",40:"SpecialInstructions",42:"ActionAdvised",45:"RefService",47:"RefDate",50:"RefNumber",55:"DateCreated",60:"TimeCreated",62:"DigitalCreationDate",63:"DigitalCreationTime",65:"OriginatingProgram",70:"ProgramVersion",75:"ObjectCycle",80:"Byline",85:"BylineTitle",90:"City",92:"Sublocation",95:"State",100:"CountryCode",101:"CountryName",103:"OrigTransRef",105:"Headline",110:"Credit",115:"Source",116:"CopyrightNotice",118:"Contact",120:"Caption",122:"WriterEditor",130:"ImageType",131:"ImageOrientation",135:"LanguageID"},t.IptcMap.prototype.getText=function(t){var e=this.get(t);return String(e)},function(t){var e,r=t.tags,a=t.map||{};for(e in r)r.hasOwnProperty(e)&&(a[r[e]]=e)}(t.IptcMap.prototype),t.IptcMap.prototype.getAll=function(){var t,e,r={};for(t in this)this.hasOwnProperty(t)&&(e=this.tags[t])&&(r[e]=this.getText(e));return r}})?a.apply(e,n):a)||(t.exports=i)}()},function(t,e,r){var a,n,i;!function(o){"use strict";n=[r(0),r(2),r(1)],void 0===(i="function"==typeof(a=function(t){var e=t.hasCanvasOption,r=t.hasMetaOption,a=t.transformCoordinates,n=t.getTransformedOptions;t.hasCanvasOption=function(r){return!!r.orientation||e.call(t,r)},t.hasMetaOption=function(e){return e&&!0===e.orientation||r.call(t,e)},t.transformCoordinates=function(e,r){a.call(t,e,r);var n=e.getContext("2d"),i=e.width,o=e.height,s=e.style.width,u=e.style.height,c=r.orientation;if(c&&!(c>8))switch(c>4&&(e.width=o,e.height=i,e.style.width=u,e.style.height=s),c){case 2:n.translate(i,0),n.scale(-1,1);break;case 3:n.translate(i,o),n.rotate(Math.PI);break;case 4:n.translate(0,o),n.scale(1,-1);break;case 5:n.rotate(.5*Math.PI),n.scale(1,-1);break;case 6:n.rotate(.5*Math.PI),n.translate(0,-o);break;case 7:n.rotate(.5*Math.PI),n.translate(i,-o),n.scale(-1,1);break;case 8:n.rotate(-.5*Math.PI),n.translate(-i,0)}},t.getTransformedOptions=function(e,r,a){var i,o,s=n.call(t,e,r),u=s.orientation;if(!0===u&&a&&a.exif&&(u=a.exif.get("Orientation")),!u||u>8||1===u)return s;for(o in i={},s)s.hasOwnProperty(o)&&(i[o]=s[o]);switch(i.orientation=u,u){case 2:i.left=s.right,i.right=s.left;break;case 3:i.left=s.right,i.top=s.bottom,i.right=s.left,i.bottom=s.top;break;case 4:i.top=s.bottom,i.bottom=s.top;break;case 5:i.left=s.top,i.top=s.left,i.right=s.bottom,i.bottom=s.right;break;case 6:i.left=s.top,i.top=s.right,i.right=s.bottom,i.bottom=s.left;break;case 7:i.left=s.bottom,i.top=s.right,i.right=s.top,i.bottom=s.left;break;case 8:i.left=s.bottom,i.top=s.left,i.right=s.top,i.bottom=s.right}return i.orientation>4&&(i.maxWidth=s.maxHeight,i.maxHeight=s.maxWidth,i.minWidth=s.minHeight,i.minHeight=s.minWidth,i.sourceWidth=s.sourceHeight,i.sourceHeight=s.sourceWidth),i}})?a.apply(e,n):a)||(t.exports=i)}()}]);
// # sourceMappingURL=ndarray-browser-min.js.map
</script>
<script src="../../demo/anet/image-loader.js"></script>
<script>
const imageSize = 224;
</script>

<p id="loading">Loading...</p>

<div class="upload-btn-wrapper">
    <button class="btn" id="btn" hidden>Choose an Image</button>
    <input id="fileselect" type="file" accept="image/*" capture="camera">
</div>

<div id="predictions" class="result"></div>

<p>*This program runs locally, your image will not be uploaded.</p>

<script src="../../demo/anet/index.js"></script>
  </article>
  <aside class="table-content" id="site-toc">
  <div class="table-content-title">
    <i class="fa fa-arrow-right fa-lg" id="site-toc-hide-btn"></i>
    <span>目录</span>
  </div>
  <div class="table-content-main">
    
  </div>
</aside>
  
    <aside class="passage-copyright">
      <div>本文作者: Yaa</div>
      
        <div>
          原文链接: 
          <a href="" target="_blank">http://zyayoung.gitee.io/blog/passages/ANetDemo/</a>
        </div>
      
      <div>
        转载请注明出处!
      </div>
    </aside>
  
  
</div>

    </main>
    
      
<div class="site-comment-contanier" data-plateform="leancloud">
  
    <p id="site-comment-info">
      <i class="fa fa-spinner fa-spin"></i> 评论加载中
    </p>
    <div id="site-comment"></div>
  
</div>
    
    <div class="site-footer-wrapper">
  <footer class="site-footer">
    
      
        <div class="site-footer-col">
          <h5 class="site-footer-title">博客推荐</h5>
          
            <span class="site-footer-item">
              <a href="https://scarlet-climax.github.io/" target="_blank">Scarlet Devil Mansion</a>
            </span>
          
        </div>
      
    
    <div class="site-footer-info">
      <i class="fa fa-clock-o"></i> 本站已稳定运行<span id="site-time"></span>
    </div>
    
      <div class="site-footer-info">
        <i class="fa fa-paw"></i> 您是本站第 <span id="site-count"></span> 位访客
      </div>
    
    
      <div class="site-footer-info">
        <i class="fa fa-at"></i> Email: 1328410180@qq.com
      </div>
    
    <div class="site-footer-info">
      <i class="fa fa-copyright"></i> 
      2019 <a href="https://github.com/dongyuanxin/theme-ad/" target="_blank">Theme-AD</a>.
      Created by <a href="https://godbmw.com/" target="_blank">GodBMW</a>.
      All rights reserved.
    </div>
  </footer>
</div>
    <div id="site-layer" style="display:none;">
  <div class="site-layer-content">
    <div class="site-layer-header">
      <span class="site-layer-header-title" id="site-layer-title"></span>
      <i class="fa fa-close" id="site-layer-close"></i>
    </div>
    <div class="site-layer-body" id="site-layer-container">
      <div class="site-layer-input" id="site-layer-search" style="display: none;">
        <input type="text">
        <i class="fa fa-search"></i>
      </div>
      
      <div id="site-layer-welcome" style="display:none;"></div>
    </div>
  </div>
</div>
    

<div class="bottom-bar">
  <div class="bottom-bar-left">
    <a href="javascript:void(0);" data-enable="false">
      <i class="fa fa-arrow-left"></i>
    </a>
    <a href="/blog/passages/拯救被压爆的表情包Demo/" data-enable="true">
      <i class="fa fa-arrow-right"></i>
    </a>
  </div>
  <div class="bottom-bar-right">
    <a href="javascript:void(0);" data-enable="true" id="site-toc-show-btn">
      <i class="fa fa-bars"></i>
    </a>
    
      <a href="#site-comment" data-enable="true">
        <i class="fa fa-commenting"></i>
      </a>
    
    <a href="javascript:void(0);" id="site-toggle-share-btn">
      <i class="fa fa-share-alt"></i>
    </a>
    
    <a href="javascript:void(0);" id="back-top-btn">
      <i class="fa fa-chevron-up"></i>
    </a>
  </div>
</div>
    <div id="share-btn">
  
  
  
    <a id="share-btn-weibo" href="javascript:void(0);" target="_blank">
      <i class="fa fa-weibo"></i>
    </a>
  
  
    <a id="share-btn-qq" href="javascript:void(0);" target="_blank">
      <i class="fa fa-qq"></i>
    </a>
  
  
    <a id="share-btn-wechat" href="javascript:void(0);" target="_blank">
      <i class="fa fa-wechat"></i>
    </a>
  
</div>
    





    
  </body>
</html>